﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using park.cn.linkit.epark;

namespace park.dispatchsystem
{
    public partial class proxy : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Params["m"] != null)
            {
                string result = "{}";
                Response.ContentType = "application/json";
                string m = Request.Params["m"];
                ServiceList ws = new ServiceList();
                string lng0, lng1, lat0, lat1;
                switch (m)
                {
                    case "getAllInspectionManOfDistrict":
                        result = ws.getAllInspectionManOfDistrict(Request.Params["id"]);
                        break;
                    case "getCollectorDetail":
                        result = ws.getCollectorDetail(Request.Params["id"], Request.Params["size"], Request.Params["number"]);
                        break;
                    case "getRepeaterDetail":
                        result = ws.getRepeaterDetail(Request.Params["id"], Request.Params["size"], Request.Params["number"]);
                        break;
                    case "ClickCollector":
                        result = ws.ClickCollector((Request.Params["id"]));
                        break;
                    case "ClickRepeater":
                        result = ws.ClickRepeater((Request.Params["id"]));
                        break;
                    case "GetRepeaterPlaceHolderRate":
                        lng0 = Request.Params["lng0"];
                        lng1 = Request.Params["lng1"];
                        lat0 = Request.Params["lat0"];
                        lat1 = Request.Params["lat1"];
                        result = ws.GetRepeaterPlaceHolderRate(lng0, lng1, lat0, lat1);
                        break;
                    case "GetRepeaterBug":
                        lng0 = Request.Params["lng0"];
                        lng1 = Request.Params["lng1"];
                        lat0 = Request.Params["lat0"];
                        lat1 = Request.Params["lat1"];
                        result = ws.GetRepeaterBug(lng0, lng1, lat0, lat1);
                        break;
                    case "GetRepeaterRuleBreak":
                        lng0 = Request.Params["lng0"];
                        lng1 = Request.Params["lng1"];
                        lat0 = Request.Params["lat0"];
                        lat1 = Request.Params["lat1"];
                        result = ws.GetRepeaterRuleBreak(lng0, lng1, lat0, lat1);
                        break;
                    case "GetCollectorPlaceHolderRate":
                        lng0 = Request.Params["lng0"];
                        lng1 = Request.Params["lng1"];
                        lat0 = Request.Params["lat0"];
                        lat1 = Request.Params["lat1"];
                        result = ws.GetCollectorPlaceHolderRate(lng0, lng1, lat0, lat1);
                        break;
                    case "GetCollectorBug":
                        lng0 = Request.Params["lng0"];
                        lng1 = Request.Params["lng1"];
                        lat0 = Request.Params["lat0"];
                        lat1 = Request.Params["lat1"];
                        result = ws.GetCollectorBug(lng0, lng1, lat0, lat1);
                        break;
                    case "GetCollectorRuleBreak":
                        lng0 = Request.Params["lng0"];
                        lng1 = Request.Params["lng1"];
                        lat0 = Request.Params["lat0"];
                        lat1 = Request.Params["lat1"];
                        result = ws.GetCollectorRuleBreak(lng0, lng1, lat0, lat1);
                        break;
                    case "getDistrictScopeInfoData":
                        result = ws.getDistrictScopeInfoData((Request.Params["id"]));
                        break;
                    case "getDistrictScopeBorderData":
                        result = ws.getDistrictScopeBorderData((Request.Params["id"]));
                        break;
                    case "getInitLngLat":
                        result = ws.getInitLngLat();
                        break;
                    case "getCityRegions":
                        result = ws.getCityRegions();
                        break;
                    case "getDistrictOfRegion":
                        result = ws.getDistrictOfRegion(int.Parse(Request.Params["id"]));
                        break;
                    case "getRegionScopeBorderData":
                        result = ws.getRegionScopeBorderData(int.Parse(Request.Params["id"]));
                        break;
                    case "getRegionScopeInfoData":
                        result = ws.getRegionScopeInfoData(int.Parse(Request.Params["id"]));
                        break;
                    case "getDistrictPlaceHolderRateData":
                        result = ws.getDistrictPlaceHolderRateData(int.Parse(Request.Params["id"]));
                        break;
                    case "getRepeaterType_0InfoData":
                        result = ws.getRepeaterType_0InfoData(int.Parse(Request.Params["id"]));
                        break;
                    case "getDistrictIllegalData":
                        result = ws.getDistrictIllegalData(int.Parse(Request.Params["id"]));
                        break;
                    case "getRepeaterType_1InfoData":
                        result = ws.getRepeaterType_1InfoData(int.Parse(Request.Params["id"]));
                        break;
                    case "getDistrictBugData":
                        result = ws.getDistrictBugData(int.Parse(Request.Params["id"]));
                        break;
                    case "getRepeaterType_2InfoData":
                        result = ws.getRepeaterType_2InfoData(int.Parse(Request.Params["id"]));
                        break;
                    case "searchDistrict":
                        result = ws.searchDistrict(Uri.UnescapeDataString(Request.Params["name"]));
                        break;                    
                    case "parkUserNotify":
                        result = ws.parkUserNotify(int.Parse(Request.Params["id"]), Request.Params["number"]);
                        break;
                    case "listParkingOfPark":
                        result = ws.listParkingOfPark(int.Parse(Request.Params["id"]), Request.Params["start"], Request.Params["end"], int.Parse(Request.Params["size"]), int.Parse(Request.Params["number"]));
                        break;
                    case "getAllInspectionManOfRegion":
                        result = ws.getAllInspectionManOfRegion(int.Parse(Request.Params["id"]));
                        break;
                    case "searchInspenctionMen":
                        result = ws.searchInspenctionMen(Uri.UnescapeDataString(Request.Params["name"]));
                        break;
                    case "getRouteOfInspectionMan":
                        result = ws.getRouteOfInspectionMan(int.Parse(Request.Params["id"]));
                        break;
                    case "dispatchInspectionMan":
                        int sn = -1;
                        try
                        {
                            int.TryParse(Request.Params["sn"], out sn);
                        }
                        catch { }
                        result = ws.dispatchInspectionMan(sn, Request.Params["taskNumber"],
                            Request.Params["managerId"], Request.Params["inspectionManId"], Request.Params["taskTime"]);
                        break;

                };
                Response.Write(result);
                Response.End();
            }
        }
    }
}